package com.hrms.controller;


import com.hrms.pojo.ContractManage;
import com.hrms.pojo.EmpInformation;
import com.hrms.service.ContractManageService;
import com.hrms.service.EmpInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LK
 * @since 2021-10-19
 */
@RestController
@RequestMapping("/contractManage")
public class ContractManageController {
    @Autowired
    ContractManageService contractManageService;

    @RequestMapping("/conList")
    public HashMap<String,Object> listPage(ContractManage contractManage){
        return contractManageService.select(contractManage);

    }
    //修改
    @RequestMapping("/update")
    public HashMap<String,Object>  update(ContractManage contractManage){
        return contractManageService.update(contractManage);
    }
    //新增
    @RequestMapping("/add")
    public HashMap<String,Object> add( ContractManage contractManage){
        return contractManageService.add(contractManage);
    }

    //删除
    @RequestMapping("/del")
    public HashMap<String,Object> del(Integer id){
        return contractManageService.del(id);
    }

    @GetMapping("ContractExcelDownloadsEasyExcel")
    public void ContractDownloadsEasyExcel(HttpServletResponse response) throws IOException {
        contractManageService.excelExport(response);
    }
}

